package com.atguigu.my.chapter01

import scala.io.StdIn

/**
 *
 * @description: input测试
 * @time: 2020-05-20 17:06
 * @author: baojinlong 
 **/
object VarDemo03 {
  def main(args: Array[String]): Unit = {
    println("请输入姓名")
    // StdIn是object对象可以直接使用
    val name = StdIn.readLine()
    println("请输入薪水")
    val salary = StdIn.readFloat()
    printf("姓名%s 薪水%.2f", name, salary)
    //    Cat.sayHi()
    //    Cat.sayHello2()
    Cat.sayHi()
  }

  // 声明一个对象
  object Cat extends AAA {
    def sayHi(): Unit = {
      println("小狗汪汪叫.")
    }
  }

  trait AAA {
    def sayHello2(): Unit = {
      println("sayHello")
    }
  }

}
